package cn.gok.oa.email.controller;


import cn.gok.oa.email.service.IMailRecipientsService;
import cn.gok.oa.log.LogAnnotation;
import cn.gok.oa.util.ResultData;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author gok
 * @since 2022-08-09
 */
@RestController
@RequestMapping("/email/recipients")
public class MailRecipientsController {
    @Autowired
    IMailRecipientsService iMailRecipientsService;

    @RequestMapping(value = "/delete_send",method = RequestMethod.DELETE)
    @LogAnnotation("删除收件箱中的邮件")
    public ResultData delete_Send(@Param("eid") Integer eid,@Param("uid") Integer uid){
        Map<String,Object> map = new HashMap<>();
        map.put("eid",eid);
        map.put("uid",uid);
        if(iMailRecipientsService.removeByMap(map))
            return ResultData.success();
        else
            return ResultData.fail();
    }
}
